/*******************************************************************************
 *
 *      Filename: Application.h
 *   Description:
 *        Author: [kb]ypp
 *    Created at: November 28, 2005
 *
 ******************************************************************************/

#ifndef APPLICATION_H
#define APPLICATION_H

#include "Timer.h"
#include <string>
#include <vector>

namespace hq {

class GLWindow;
class Scene;

//! @brief Class for application
//!
//! Just create object of this class, add scenes to it and call run()
//! member-function
class Application {
public:
    //! @brief Constructor
    Application( const std::string &title, int width, int height, bool fs );
    //! @brief Destructor
    ~Application();

    //! @brief Add a new scene to the list
    void addScene( Scene *scene );
    //! @brief Window resize event handler
    void resize( int width, int height );

    //! @brief Run main loop
    void run();
    //! @brief Suspend the application (when minimized, for example)
    void suspend();
    //! @brief Resume the application
    void resume();
    //! @brief Application must break main loop and exit as quick as possible
    void quit();

private:
    //! @brief Copy-construction disabled
    Application( const Application& );
    //! @brief Assignment disabled
    const Application& operator=( const Application& );

    GLWindow *m_window;
    Timer m_timer;
    std::vector< Scene* > m_sceneList;
    bool m_done;
};

} // namespace hq

#endif // APPLICATION_H
